<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>MongoRegex 类</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongodate.tostring.html">MongoDate::__toString</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongoregex.construct.html">MongoRegex::__construct</a></div>
 <div class="up"><a href="mongo.types.html">Types</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.mongoregex" class="reference">

 <h1 class="title">MongoRegex 类</h1>
 

 <div class="partintro"><p class="verinfo">(PECL mongo &gt;=0.8.1)</p>


  <div class="section" id="mongoregex.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    这个类用于创建一个正则表达式。
    通常这些表达式用于查询数据库中匹配的字符串。不常用的是，它们可以保存到数据库并用于检索。
   </p>
   <p class="para">
    Mongo 能够识别六种正则表达式标记（flag）：
   </p>
   <ul class="itemizedlist">
    <li class="listitem">
     <p class="para">
      <em>i</em>
     </p>
     <p class="para">
      忽略大小写
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      <em>m</em>
     </p>
     <p class="para">
      多行
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      <em>x</em>
     </p>
     <p class="para">
      能够包含注释
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      <em>l</em>
     </p>
     <p class="para">
      语言环境
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      <em>s</em>
     </p>
     <p class="para">
      dotall，&quot;.&quot; 匹配任何字符，包括换行符。
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      <em>u</em>
     </p>
     <p class="para">
      匹配 Unicode
     </p>
    </li>
   </ul>
  </div>


  <div class="section" id="mongoregex.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">MongoRegex</strong>
     </span>
     {</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 字段 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="type">string</span>
      <var class="varname">$<var class="varname">regex</var></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="type">string</span>
      <var class="varname">$<var class="varname">flags</var></var>
    ;</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="mongoregex.construct.html" class="methodname">__construct</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$regex</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="mongoregex.tostring.html" class="methodname">__toString</a></span>
    ( <span class="methodparam">void</span>
   )</div>

   }</div>


  </div>

 </div>

 



















<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="mongoregex.construct.html">MongoRegex::__construct</a> — 创建一个新的正则表达式</li><li><a href="mongoregex.tostring.html">MongoRegex::__toString</a> — 正则表达式的字符串表达形式</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mongodate.tostring.html">MongoDate::__toString</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongoregex.construct.html">MongoRegex::__construct</a></div>
 <div class="up"><a href="mongo.types.html">Types</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
